package ar.com.laley.centro.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.classic.Session;
import org.hibernate.criterion.Expression;

import ar.com.laley.centro.beans.AreaInteres;
import ar.com.laley.centro.beans.HibernateUtil;


public class AreaInteresDAOImpl extends GenericDAOImpl implements AreaInteresDAO {

	/**
	 * @return lista de consultas a exportar
	 * @throws Exception
	 */
	public List exportar() throws Exception {

		return null;
	}



	/**
	 * @param desde,hasta
	 * @return lista con todas las consultas realizadas entre un rango de fechas
	 * @throws Exception
	 */
	public AreaInteres listar(int area) throws Exception {
		AreaInteres result = new AreaInteres();
		
		HibernateUtil.currentSession();
		Session session = (Session) HibernateUtil.currentSession();
		Criteria crit = session.createCriteria(AreaInteres.class);
		crit.add(Expression.eq("areaId", new Integer(area)));
		result = (AreaInteres) crit.uniqueResult();	
	
		return result;
	}








}
